<?php

use yii\helpers\Html;
use yii\grid\GridView;
use common\models\User;

/* @var $this yii\web\View */
/* @var $searchModel common\models\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '用户列表';
$this->params['breadcrumbs'][] = $this->title;
?>
  <p>
        <?= Html::a('添加用户', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'tableOptions' => ['class' => 'table table-striped table-bordered','style'=>'width:auto;max-width:none;'],
        'options' => ['class' => 'grid-view','style'=>'overflow:auto'],
        'columns' => [
            //['class' => 'yii\grid\SerialColumn'],

            'id',
            'username',
            //'password_hash',
            'phone',
            'email:email',
             'real_name',
            // 'third_user_id',
             //'status',
             [
                'attribute' => 'status',
                'value' => function ($model, $key, $index, $column) {
                    return User::itemAlias("status", $model->status);
                },
                'filter'=>User::itemAlias("status"),
            ],
             'available_money',
             'create_time',
            // 'reigster_ip',
             'last_login_time',
            // 'last_login_ip',
            ['class' => 'yii\grid\ActionColumn', 'template' => '{view}',],
        ],
    ]); ?>
</div>

